﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PCLawPrototype
{
    public partial class ManageExpensesIncurred : ManageRibbonForm
    {
        public ManageExpensesIncurred()
        {
            InitializeComponent();
            this.WindowState = FormWindowState.Maximized;
        }

        private void ManageExpensesIncurred_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            e.Cancel = true;
            ((DStarter)this.MdiParent).SetRPEventVisible(false);
        }
        #region Overrides of ManageRibbonForm

        public override void Add()
        {
            NewExpensesIncurred newExpensesIncurred = new NewExpensesIncurred();
            newExpensesIncurred.ShowDialog();
        }

        public override void Edit()
        {
            NewExpensesIncurred newExpensesIncurred = new NewExpensesIncurred(true);
            newExpensesIncurred.ShowDialog();
        }

        public override void Delete()
        {
            if (lstClient.SelectedIndices.Count > 0)
                lstClient.Items.RemoveAt(lstClient.SelectedIndices[0]);
        }

        public override void Reload()
        {
            MessageBox.Show("Reload data from database and fill data to list!", "Description for function", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public override void Active()
        {
        }

        public override void ViewPUMatter()
        {
            PUMatterFrm puMatterFrm = new PUMatterFrm();
            puMatterFrm.ShowDialog();
        }

        public override void ViewPUClient()
        {
            PUClientFrm puClientFrm = new PUClientFrm();
            puClientFrm.ShowDialog();
        }

        public override void StartSearch()
        {
            MessageBox.Show("Data filtered!");
        }

        #endregion

        private void ManageExpensesIncurred_Activated(object sender, EventArgs e)
        {
            ((DStarter)this.MdiParent).SetActiveVisible(false);
            ((DStarter)this.MdiParent).SetRPGExpensesVisible(true);
            ((DStarter)this.MdiParent).SetEventFocus();
        }

        private void ManageExpensesIncurred_Deactivate(object sender, EventArgs e)
        {
            ((DStarter)this.MdiParent).SetActiveVisible(true);
            ((DStarter)this.MdiParent).SetRPGExpensesVisible(false);
        }

        private void lstClient_DoubleClick(object sender, EventArgs e)
        {
            NewExpensesIncurred newExpensesIncurred = new NewExpensesIncurred(true);
            newExpensesIncurred.ShowDialog();
        }

        private void lstClient_Click(object sender, EventArgs e)
        {
            ((DStarter)this.MdiParent).SetEventFocus();
        }
    }
}
